package com.hmc.test.cloneableTest.surfaceClone;

public class School implements Cloneable{
    private String name;
    private String location;
    private Student student;

    public School(String name, String location, Student student) {
        this.name = name;
        this.location = location;
        this.student = student;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    @Override
    public School clone() throws CloneNotSupportedException {
        return (School)super.clone();
    }

    @Override
    public String toString() {
        return "School{" +
                "name='" + name + '\'' +
                ", location='" + location + '\'' +
                ", student=" + student +
                '}' + "\nhashcode:\t" + this.hashCode() +
                "\nstuHashcode:\t" + student.hashCode() +
                "\nbirthday\t" + student.getBirthday().hashCode();
    }
}
